package com.tmt.im.jpa.entity;

import com.tmt.data.jpa.entity.TmtBaseEntity;
import com.tmt.data.jpa.entity.TmtBaseEntityId;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;

import java.io.Serial;

/**
 * 云信抄送事件表
 *
 * @Description TODO
 * @Author wuyi
 * @Date 2024/8/6 21:11
 * @Version 1.0
 **/
@Getter
@Setter
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "yun_xin_event")
@Tag(name = "YunXinEvent", description = "云信抄送事件表")
public class YunXinEvent extends TmtBaseEntityId {

    @Serial
    private static final long serialVersionUID = -3435980343491081876L;

    @Schema(description = "云信事件内容，最大长度1024字节")
    @Column(columnDefinition = "VARCHAR(1024)")
    private String content;

    @Schema(description = "该云信事件是否已处理")
    @Column(nullable = false, columnDefinition = "TINYINT(1)")
    private boolean handled = false;

    @Schema(description = "处理该云信事件时是否报错，handled=true时本字段为null表示未报错")
    @Column(columnDefinition = "TINYINT(1)")
    private String handleError;

}
